<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>amis dynamic page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <!--jQuery-->
    <script src="/plugin/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <!--amis-->
    <link rel="stylesheet" href="/amis/sdk.css"/>
    <link rel="stylesheet" href="/amis/helper.css"/>
    <link rel="stylesheet" href="/amis/iconfont.css"/>
    <style>
        html, body, .app-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<div>
    <!--/*@thymesVar id="amisJson" type=""*/-->
    <input hidden type="text" id="amisJson" th:value="${amisJson}">
</div>
<div id="root" class="app-wrapper"></div>
<!--amis-->
<script src="/amis/sdk.js"></script>
<script type="text/javascript">
    let amisJson = $("#amisJson").val();
    (function () {
        console.log(amisJson);
        let amis = amisRequire('amis/embed');
        // 通过替换下面这个配置来生成不同页面
        let amisScoped = amis.embed('#root', JSON.parse(amisJson));
    })();
</script>
</body>
</html>
